<?php

namespace app\common\validate;

use think\Validate;

class NewsComment extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'user_id|用户' => 'require|number',
        'news_id|新闻' => 'require|number',
        'content|评论内容' => 'require|length:2,200',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'user_id.require' => '用户不能为空',
        'news_id.require' => '新闻不能为空',
        'content.require' => '评论内容不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [
            'user_id',
            'news_id',
            'content'
        ],
    ];
    
}
